package com.ecdc.soexample;

import java.lang.reflect.Field;

import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.WindowManager;
import android.widget.Toast;



import org.xutils.DbManager;
import org.xutils.x;

import bluetooth.NotificationCollectorMonitorService;
import bluetooth.WeChatAccessibilityService;
import utils.DbUitls;

/**
 * Created by wangfei on 2018/1/23.
 */

public class App extends Application {

    private static final String TAG = App.class.getName();
    public static final String UPDATE_STATUS_ACTION = "com.umeng.message.example.action.UPDATE_STATUS";
    private Handler handler;
    public static DbManager dbManager;
    public static int screenWidth, screenHeight;
    public static Context context;


    @Override
    public void onCreate() {
        super.onCreate();
        context=getApplicationContext();


        //初始化xutils
        x.Ext.init(this);
        x.Ext.setDebug(true); // 是否输出debug日志
        dbManager = DbUitls.getDbManager();
        //获取屏幕的宽高
        WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics dm = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(dm);
        screenWidth = dm.widthPixels; // 屏幕宽度（像素）
        screenHeight = dm.heightPixels; // 屏幕高度（像素）

        //初始化异常
        CrashHandler handler = CrashHandler.getInstance();
        handler.init(getApplicationContext()); // 在Appliction里面设置我们的异常处理器为UncaughtExceptionHandler处理器

    }






}
